// source --> https://www.creditsmart.co.za/wp-includes/js/jquery/jquery.min.js?ver=3.6.0 /*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 https://www.creditsmart.co.za/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 /*! jQuery Migrate v1.4.1 | (c) jQuery Foundation and other contributors | jquery.org/license */ "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b,c){function d(c){var d=b.console;f[c]||(f[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function e(b,c,e,f){if(Object.defineProperty)try{return void Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){return d(f),e},set:function(a){d(f),e=a}})}catch(g){}a._definePropertyBroken=!0,b[c]=e}a.migrateVersion="1.4.1";var f={};a.migrateWarnings=[],b.console&&b.console.log&&b.console.log("JQMIGRATE: Migrate is installed"+(a.migrateMute?"":" with logging active")+", version "+a.migrateVersion),a.migrateTrace===c&&(a.migrateTrace=!0),a.migrateReset=function(){f={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&d("jQuery is not compatible with Quirks Mode");var g=a("",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr( props, pass ) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;g https://www.creditsmart.co.za/wp-content/plugins/add-facebook/public/scripts/facebook.js?ver=5.1.6 /*! * Packery PACKAGED v2.0.0 * Gapless, draggable grid layouts * * Licensed GPLv3 for open source use * or Packery Commercial License for commercial use * * http://packery.metafizzy.co * Copyright 2016 Metafizzy */ !function(t,e){"use strict";"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function h(t,e,n){var o,s="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var c=u[e];if(!c||"_"==e.charAt(0))return void r(s+" is not a valid method");var d=c.apply(u,n);o=void 0===o?d:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new s(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return n(e||t.jQuery),i}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function o(){if(!c){c=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s.isBoxSizeOuter=r=200==t(o.width),i.removeChild(e)}}function s(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=n(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var c=a.isBorderBox="border-box"==s.boxSizing,d=0;u>d;d++){var f=h[d],l=s[f],p=parseFloat(l);a[f]=isNaN(p)?0:p}var m=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,x=a.borderTopWidth+a.borderBottomWidth,b=c&&r,E=t(s.width);E!==!1&&(a.width=E+(b?0:m+_));var T=t(s.height);return T!==!1&&(a.height=T+(b?0:g+x)),a.innerWidth=a.width-(m+_),a.innerHeight=a.height-(g+x),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,c=!1;return s}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var s=this._onceEvents&&this._onceEvents[t];o;){var r=s&&s[o];r&&(this.off(t,o),delete s[o]),o.apply(this,e),n+=r?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i=t.x+e&&this.y+this.height>=t.y+i},e.overlaps=function(t){var e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,o=t.y+t.height;return this.xt.x&&this.yt.y},e.getMaximalFreeRects=function(e){if(!this.overlaps(e))return!1;var i,n=[],o=this.x+this.width,s=this.y+this.height,r=e.x+e.width,a=e.y+e.height;return this.yr&&(i=new t({x:r,y:this.y,width:o-r,height:this.height}),n.push(i)),s>a&&(i=new t({x:this.x,y:a,width:this.width,height:s-a}),n.push(i)),this.x=t.width&&this.height>=t.height},t}),function(t,e){if("function"==typeof define&&define.amd)define("packery/packer",["./rect"],e);else if("object"==typeof module&&module.exports)module.exports=e(require("./rect"));else{var i=t.Packery=t.Packery||{};i.Packer=e(i.Rect)}}(window,function(t){"use strict";function e(t,e,i){this.width=t||0,this.height=e||0,this.sortDirection=i||"downwardLeftToRight",this.reset()}var i=e.prototype;i.reset=function(){this.spaces=[];var e=new t({x:0,y:0,width:this.width,height:this.height});this.spaces.push(e),this.sorter=n[this.sortDirection]||n.downwardLeftToRight},i.pack=function(t){for(var e=0;e=t.x+t.width&&i.height>=t.height-.01;if(n){t.y=i.y,this.placed(t);break}}},i.rowPack=function(t){for(var e=0;e=t.y+t.height&&i.width>=t.width-.01;if(n){t.x=i.x,this.placed(t);break}}},i.placeInSpace=function(t,e){t.x=e.x,t.y=e.y,this.placed(t)},i.placed=function(t){for(var e=[],i=0;ii&&1>n;return o?void this.goTo(t,e):void a.apply(this,arguments)},s.enablePlacing=function(){this.removeTransitionStyles(),this.isTransitioning&&n&&(this.element.style[n]="none"),this.isTransitioning=!1,this.getSize(),this.layout._setRectSize(this.element,this.rect),this.isPlacing=!0},s.disablePlacing=function(){this.isPlacing=!1},s.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},s.showDropPlaceholder=function(){var t=this.dropPlaceholder;t||(t=this.dropPlaceholder=document.createElement("div"),t.className="packery-drop-placeholder",t.style.position="absolute"),t.style.width=this.size.width+"px",t.style.height=this.size.height+"px",this.positionDropPlaceholder(),this.layout.element.appendChild(t)},s.positionDropPlaceholder=function(){this.dropPlaceholder.style[n]="translate("+this.rect.x+"px, "+this.rect.y+"px)"},s.hideDropPlaceholder=function(){this.layout.element.removeChild(this.dropPlaceholder)},o}),function(t,e){"function"==typeof define&&define.amd?define(["get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):t.Packery=e(t.getSize,t.Outlayer,t.Packery.Rect,t.Packery.Packer,t.Packery.Item)}(window,function(t,e,i,n,o){"use strict";function s(t,e){return t.position.y-e.position.y||t.position.x-e.position.x}function r(t,e){return t.position.x-e.position.x||t.position.y-e.position.y}function a(t,e){var i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}i.prototype.canFit=function(t){return this.width>=t.width-1&&this.height>=t.height-1};var h=e.create("packery");h.Item=o;var u=h.prototype;u._create=function(){e.prototype._create.call(this),this.packer=new n,this.shiftPacker=new n,this.isEnabled=!0,this.dragItemCount=0;var t=this;this.handleDraggabilly={dragStart:function(){t.itemDragStart(this.element)},dragMove:function(){t.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){t.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(e,i){i&&t.itemDragStart(e.currentTarget)},drag:function(e,i){i&&t.itemDragMove(e.currentTarget,i.position.left,i.position.top)},stop:function(e,i){i&&t.itemDragEnd(e.currentTarget)}}},u._resetLayout=function(){this.getSize(),this._getMeasurements();var t,e,i;this._getOption("horizontal")?(t=1/0,e=this.size.innerHeight+this.gutter,i="rightwardTopToBottom"):(t=this.size.innerWidth+this.gutter,e=1/0,i="downwardLeftToRight"),this.packer.width=this.shiftPacker.width=t,this.packer.height=this.shiftPacker.height=e,this.packer.sortDirection=this.shiftPacker.sortDirection=i,this.packer.reset(),this.maxY=0,this.maxX=0},u._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},u._getItemLayoutPosition=function(t){if(this._setRectSize(t.element,t.rect),this.isShifting||this.dragItemCount>0){var e=this._getPackMethod();this.packer[e](t.rect)}else this.packer.pack(t.rect);return this._setMaxXY(t.rect),t.rect},u.shiftLayout=function(){this.isShifting=!0,this.layout(),delete this.isShifting},u._getPackMethod=function(){return this._getOption("horizontal")?"rowPack":"columnPack"},u._setMaxXY=function(t){this.maxX=Math.max(t.x+t.width,this.maxX),this.maxY=Math.max(t.y+t.height,this.maxY)},u._setRectSize=function(e,i){var n=t(e),o=n.outerWidth,s=n.outerHeight;(o||s)&&(o=this._applyGridGutter(o,this.columnWidth),s=this._applyGridGutter(s,this.rowHeight)),i.width=Math.min(o,this.packer.width),i.height=Math.min(s,this.packer.height)},u._applyGridGutter=function(t,e){if(!e)return t+this.gutter;e+=this.gutter;var i=t%e,n=i&&1>i?"round":"ceil";return t=Math[n](t/e)*e},u._getContainerSize=function(){return this._getOption("horizontal")?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},u._manageStamp=function(t){var e,n=this.getItem(t);if(n&&n.isPlacing)e=n.rect;else{var o=this._getElementOffset(t);e=new i({x:this._getOption("originLeft")?o.left:o.right,y:this._getOption("originTop")?o.top:o.bottom})}this._setRectSize(t,e),this.packer.placed(e),this._setMaxXY(e)},u.sortItemsByPosition=function(){var t=this._getOption("horizontal")?r:s;this.items.sort(t)},u.fit=function(t,e,i){var n=this.getItem(t);n&&(this.stamp(n.element),n.enablePlacing(),this.updateShiftTargets(n),e=void 0===e?n.rect.x:e,i=void 0===i?n.rect.y:i,this.shift(n,e,i),this._bindFitEvents(n),n.moveTo(n.rect.x,n.rect.y),this.shiftLayout(),this.unstamp(n.element),this.sortItemsByPosition(),n.disablePlacing())},u._bindFitEvents=function(t){function e(){n++,2==n&&i.dispatchEvent("fitComplete",null,[t])}var i=this,n=0;t.once("layout",e),this.once("layoutComplete",e)},u.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&(this.options.shiftPercentResize?this.resizeShiftPercentLayout():this.layout())},u.needsResizeLayout=function(){var e=t(this.element),i=this._getOption("horizontal")?"innerHeight":"innerWidth";return e[i]!=this.size[i]},u.resizeShiftPercentLayout=function(){var e=this._getItemsForLayout(this.items),i=this._getOption("horizontal"),n=i?"y":"x",o=i?"height":"width",s=i?"rowHeight":"columnWidth",r=i?"innerHeight":"innerWidth",a=this[s];if(a=a&&a+this.gutter){this._getMeasurements();var h=this[s]+this.gutter;e.forEach(function(t){var e=Math.round(t.rect[n]/a);t.rect[n]=e*h})}else{var u=t(this.element)[r]+this.gutter,c=this.packer[o];e.forEach(function(t){t.rect[n]=t.rect[n]/c*u})}this.shiftLayout()},u.itemDragStart=function(t){if(this.isEnabled){this.stamp(t);var e=this.getItem(t);e&&(e.enablePlacing(),e.showDropPlaceholder(),this.dragItemCount++,this.updateShiftTargets(e))}},u.updateShiftTargets=function(t){this.shiftPacker.reset(),this._getBoundingRect();var e=this._getOption("originLeft"),n=this._getOption("originTop");this.stamps.forEach(function(t){var o=this.getItem(t);if(!o||!o.isPlacing){var s=this._getElementOffset(t),r=new i({x:e?s.left:s.right,y:n?s.top:s.bottom});this._setRectSize(t,r),this.shiftPacker.placed(r)}},this);var o=this._getOption("horizontal"),s=o?"rowHeight":"columnWidth",r=o?"height":"width";this.shiftTargetKeys=[],this.shiftTargets=[];var a,h=this[s];if(h=h&&h+this.gutter){var u=Math.ceil(t.rect[r]/h),c=Math.floor((this.shiftPacker[r]+this.gutter)/h);a=(c-u)*h;for(var d=0;c>d;d++)this._addShiftTarget(d*h,0,a)}else a=this.shiftPacker[r]+this.gutter-t.rect[r],this._addShiftTarget(0,0,a);var f=this._getItemsForLayout(this.items),l=this._getPackMethod();f.forEach(function(t){var e=t.rect;this._setRectSize(t.element,e),this.shiftPacker[l](e),this._addShiftTarget(e.x,e.y,a);var i=o?e.x+e.width:e.x,n=o?e.y:e.y+e.height;if(this._addShiftTarget(i,n,a),h)for(var s=Math.round(e[r]/h),u=1;s>u;u++){var c=o?i:e.x+h*u,d=o?e.y+h*u:n;this._addShiftTarget(c,d,a)}},this)},u._addShiftTarget=function(t,e,i){var n=this._getOption("horizontal")?e:t;if(!(0!==n&&n>i)){var o=t+","+e,s=-1!=this.shiftTargetKeys.indexOf(o);s||(this.shiftTargetKeys.push(o),this.shiftTargets.push({x:t,y:e}))}},u.shift=function(t,e,i){var n,o=1/0,s={x:e,y:i};this.shiftTargets.forEach(function(t){var e=a(t,s);o>e&&(n=t,o=e)}),t.rect.x=n.x,t.rect.y=n.y};var c=120;u.itemDragMove=function(t,e,i){function n(){s.shift(o,e,i),o.positionDropPlaceholder(),s.layout()}var o=this.isEnabled&&this.getItem(t);if(o){e-=this.size.paddingLeft,i-=this.size.paddingTop;var s=this,r=new Date;this._itemDragTime&&r-this._itemDragTime * @copyright 2010-2014 Jublo Solutions * @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 * @link https://github.com/jublonet/codebird-php */ /* jshint curly: true, eqeqeq: true, latedef: true, quotmark: double, undef: true, unused: true, trailing: true, laxbreak: true */ /* global window, document, navigator, console, Ti, ActiveXObject, module, define, require */ (function (undefined) { "use strict"; /** * Array.indexOf polyfill */ if (! Array.prototype.indexOf) { Array.prototype.indexOf = function (obj, start) { for (var i = (start || 0); i < this.length; i++) { if (this[i] === obj) { return i; } } return -1; }; } /** * A Twitter library in JavaScript * * @package codebird * @subpackage codebird-js */ /* jshint -W098 */ var Codebird = function () { /* jshint +W098 */ /** * The OAuth consumer key of your registered app */ var _oauth_consumer_key = null; /** * The corresponding consumer secret */ var _oauth_consumer_secret = null; /** * The app-only bearer token. Used to authorize app-only requests */ var _oauth_bearer_token = null; /** * The API endpoint base to use */ var _endpoint_base = "https://api.twitter.com/"; /** * The media API endpoint base to use */ var _endpoint_base_media = "https://upload.twitter.com/"; /** * The API endpoint to use */ var _endpoint = _endpoint_base + "1.1/"; /** * The media API endpoint to use */ var _endpoint_media = _endpoint_base_media + "1.1/"; /** * The API endpoint base to use */ var _endpoint_oauth = _endpoint_base; /** * API proxy endpoint */ var _endpoint_proxy = "https://api.jublo.net/codebird/"; /** * The API endpoint to use for old requests */ var _endpoint_old = _endpoint_base + "1/"; /** * Use JSONP for GET requests in IE7-9 */ var _use_jsonp = (typeof navigator !== "undefined" && typeof navigator.userAgent !== "undefined" && (navigator.userAgent.indexOf("Trident/4") > -1 || navigator.userAgent.indexOf("Trident/5") > -1 || navigator.userAgent.indexOf("MSIE 7.0") > -1 ) ); /** * Whether to access the API via a proxy that is allowed by CORS * Assume that CORS is only necessary in browsers */ var _use_proxy = (typeof navigator !== "undefined" && typeof navigator.userAgent !== "undefined" ); /** * The Request or access token. Used to sign requests */ var _oauth_token = null; /** * The corresponding request or access token secret */ var _oauth_token_secret = null; /** * The current Codebird version */ var _version = "2.5.0"; /** * Sets the OAuth consumer key and secret (App key) * * @param string key OAuth consumer key * @param string secret OAuth consumer secret * * @return void */ var setConsumerKey = function (key, secret) { _oauth_consumer_key = key; _oauth_consumer_secret = secret; }; /** * Sets the OAuth2 app-only auth bearer token * * @param string token OAuth2 bearer token * * @return void */ var setBearerToken = function (token) { _oauth_bearer_token = token; }; /** * Gets the current Codebird version * * @return string The version number */ var getVersion = function () { return _version; }; /** * Sets the OAuth request or access token and secret (User key) * * @param string token OAuth request or access token * @param string secret OAuth request or access token secret * * @return void */ var setToken = function (token, secret) { _oauth_token = token; _oauth_token_secret = secret; }; /** * Enables or disables CORS proxy * * @param bool use_proxy Whether to use CORS proxy or not * * @return void */ var setUseProxy = function (use_proxy) { _use_proxy = !! use_proxy; }; /** * Sets custom CORS proxy server * * @param string proxy Address of proxy server to use * * @return void */ var setProxy = function (proxy) { // add trailing slash if missing if (! proxy.match(/\/$/)) { proxy += "/"; } _endpoint_proxy = proxy; }; /** * Parse URL-style parameters into object * * version: 1109.2015 * discuss at: http://phpjs.org/functions/parse_str * + original by: Cagri Ekin * + improved by: Michael White (http://getsprink.com) * + tweaked by: Jack * + bugfixed by: Onno Marsman * + reimplemented by: stag019 * + bugfixed by: Brett Zamir (http://brett-zamir.me) * + bugfixed by: stag019 * - depends on: urldecode * + input by: Dreamer * + bugfixed by: Brett Zamir (http://brett-zamir.me) * % note 1: When no argument is specified, will put variables in global scope. * * @param string str String to parse * @param array array to load data into * * @return object */ var _parse_str = function (str, array) { var glue1 = "=", glue2 = "&", array2 = String(str).replace(/^&?([\s\S]*?)&?$/, "$1").split(glue2), i, j, chr, tmp, key, value, bracket, keys, evalStr, fixStr = function (str) { return decodeURIComponent(str).replace(/([\\"'])/g, "\\$1").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); }; if (! array) { array = this.window; } for (i = 0; i < array2.length; i++) { tmp = array2[i].split(glue1); if (tmp.length < 2) { tmp = [tmp, ""]; } key = fixStr(tmp[0]); value = fixStr(tmp[1]); while (key.charAt(0) === " ") { key = key.substr(1); } if (key.indexOf("\0") !== -1) { key = key.substr(0, key.indexOf("\0")); } if (key && key.charAt(0) !== "[") { keys = []; bracket = 0; for (j = 0; j < key.length; j++) { if (key.charAt(j) === "[" && !bracket) { bracket = j + 1; } else if (key.charAt(j) === "]") { if (bracket) { if (!keys.length) { keys.push(key.substr(0, bracket - 1)); } keys.push(key.substr(bracket, j - bracket)); bracket = 0; if (key.charAt(j + 1) !== "[") { break; } } } } if (!keys.length) { keys = [key]; } for (j = 0; j < keys[0].length; j++) { chr = keys[0].charAt(j); if (chr === " " || chr === "." || chr === "[") { keys[0] = keys[0].substr(0, j) + "_" + keys[0].substr(j + 1); } if (chr === "[") { break; } } /* jshint -W061 */ evalStr = "array"; for (j = 0; j < keys.length; j++) { key = keys[j]; if ((key !== "" && key !== " ") || j === 0) { key = "'" + key + "'"; } else { key = eval(evalStr + ".push([]);") - 1; } evalStr += "[" + key + "]"; if (j !== keys.length - 1 && eval("typeof " + evalStr) === "undefined") { eval(evalStr + " = [];"); } } evalStr += " = '" + value + "';\n"; eval(evalStr); /* jshint +W061 */ } } }; /** * Main API handler working on any requests you issue * * @param string fn The member function you called * @param array params The parameters you sent along * @param function callback The callback to call with the reply * @param bool app_only_auth Whether to use app-only auth * * @return mixed The API reply encoded in the set return_format */ var __call = function (fn, params, callback, app_only_auth) { if (typeof params === "undefined") { params = {}; } if (typeof app_only_auth === "undefined") { app_only_auth = false; } if (typeof callback !== "function" && typeof params === "function") { callback = params; params = {}; if (typeof callback === "boolean") { app_only_auth = callback; } } else if (typeof callback === "undefined") { callback = function () {}; } switch (fn) { case "oauth_authenticate": case "oauth_authorize": return this[fn](params, callback); case "oauth2_token": return this[fn](callback); } // reset token when requesting a new token (causes 401 for signature error on 2nd+ requests) if (fn === "oauth_requestToken") { setToken(null, null); } // parse parameters var apiparams = {}; if (typeof params === "object") { apiparams = params; } else { _parse_str(params, apiparams); //TODO } // map function name to API method var method = ""; var param, i, j; // replace _ by / var path = fn.split("_"); for (i = 0; i < path.length; i++) { if (i > 0) { method += "/"; } method += path[i]; } // undo replacement for URL parameters var url_parameters_with_underscore = ["screen_name", "place_id"]; for (i = 0; i < url_parameters_with_underscore.length; i++) { param = url_parameters_with_underscore[i].toUpperCase(); var replacement_was = param.split("_").join("/"); method = method.split(replacement_was).join(param); } // replace AA by URL parameters var method_template = method; var match = method.match(/[A-Z_]{2,}/); if (match) { for (i = 0; i < match.length; i++) { param = match[i]; var param_l = param.toLowerCase(); method_template = method_template.split(param).join(":" + param_l); if (typeof apiparams[param_l] === "undefined") { for (j = 0; j < 26; j++) { method_template = method_template.split(String.fromCharCode(65 + j)).join("_" + String.fromCharCode(97 + j)); } console.warn("To call the templated method \"" + method_template + "\", specify the parameter value for \"" + param_l + "\"."); } method = method.split(param).join(apiparams[param_l]); delete apiparams[param_l]; } } // replace A-Z by _a-z for (i = 0; i < 26; i++) { method = method.split(String.fromCharCode(65 + i)).join("_" + String.fromCharCode(97 + i)); method_template = method_template.split(String.fromCharCode(65 + i)).join("_" + String.fromCharCode(97 + i)); } var httpmethod = _detectMethod(method_template, apiparams); var multipart = _detectMultipart(method_template); var internal = _detectInternal(method_template); return _callApi( httpmethod, method, apiparams, multipart, app_only_auth, internal, callback ); }; /** * Gets the OAuth authenticate URL for the current request token * * @return string The OAuth authenticate URL */ var oauth_authenticate = function (params, callback) { if (typeof params.force_login === "undefined") { params.force_login = null; } if (typeof params.screen_name === "undefined") { params.screen_name = null; } if (_oauth_token === null) { console.warn("To get the authenticate URL, the OAuth token must be set."); } var url = _endpoint_oauth + "oauth/authenticate?oauth_token=" + _url(_oauth_token); if (params.force_login === true) { url += "?force_login=1"; if (params.screen_name !== null) { url += "&screen_name=" + params.screen_name; } } callback(url); return true; }; /** * Gets the OAuth authorize URL for the current request token * * @return string The OAuth authorize URL */ var oauth_authorize = function (params, callback) { if (typeof params.force_login === "undefined") { params.force_login = null; } if (typeof params.screen_name === "undefined") { params.screen_name = null; } if (_oauth_token === null) { console.warn("To get the authorize URL, the OAuth token must be set."); } var url = _endpoint_oauth + "oauth/authorize?oauth_token=" + _url(_oauth_token); if (params.force_login === true) { url += "?force_login=1"; if (params.screen_name !== null) { url += "&screen_name=" + params.screen_name; } } callback(url); return true; }; /** * Gets the OAuth bearer token * * @return string The OAuth bearer token */ var oauth2_token = function (callback) { if (_oauth_consumer_key === null) { console.warn("To obtain a bearer token, the consumer key must be set."); } if (typeof callback === "undefined") { callback = function () {}; } var post_fields = "grant_type=client_credentials"; var url = _endpoint_oauth + "oauth2/token"; if (_use_proxy) { url = url.replace( _endpoint_base, _endpoint_proxy ); } var xml = _getXmlRequestObject(); if (xml === null) { return; } xml.open("POST", url, true); xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xml.setRequestHeader( (_use_proxy ? "X-" : "") + "Authorization", "Basic " + _base64_encode(_oauth_consumer_key + ":" + _oauth_consumer_secret) ); xml.onreadystatechange = function () { if (xml.readyState >= 4) { var httpstatus = 12027; try { httpstatus = xml.status; } catch (e) {} var response = ""; try { response = xml.responseText; } catch (e) {} var reply = _parseApiReply(response); reply.httpstatus = httpstatus; if (httpstatus === 200) { setBearerToken(reply.access_token); } callback(reply); } }; xml.send(post_fields); }; /** * Signing helpers */ /** * URL-encodes the given data * * @param mixed data * * @return mixed The encoded data */ var _url = function (data) { if ((/boolean|number|string/).test(typeof data)) { return encodeURIComponent(data).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A"); } else { return ""; } }; /** * Gets the base64-encoded SHA1 hash for the given data * * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined * in FIPS PUB 180-1 * Based on version 2.1 Copyright Paul Johnston 2000 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for details. * * @param string data The data to calculate the hash from * * @return string The hash */ var _sha1 = function () { function n(e, b) { e[b >> 5] |= 128 << 24 - b % 32; e[(b + 64 >> 9 << 4) + 15] = b; for (var c = new Array(80), a = 1732584193, d = -271733879, h = -1732584194, k = 271733878, g = -1009589776, p = 0; p < e.length; p += 16) { for (var o = a, q = d, r = h, s = k, t = g, f = 0; 80 > f; f++) { var m; if (f < 16) { m = e[p + f]; } else { m = c[f - 3] ^ c[f - 8] ^ c[f - 14] ^ c[f - 16]; m = m << 1 | m >>> 31; } c[f] = m; m = l(l(a << 5 | a >>> 27, 20 > f ? d & h | ~d & k : 40 > f ? d ^ h ^ k : 60 > f ? d & h | d & k | h & k : d ^ h ^ k), l( l(g, c[f]), 20 > f ? 1518500249 : 40 > f ? 1859775393 : 60 > f ? -1894007588 : -899497514)); g = k; k = h; h = d << 30 | d >>> 2; d = a; a = m; } a = l(a, o); d = l(d, q); h = l(h, r); k = l(k, s); g = l(g, t); } return [a, d, h, k, g]; } function l(e, b) { var c = (e & 65535) + (b & 65535); return (e >> 16) + (b >> 16) + (c >> 16) << 16 | c & 65535; } function q(e) { for (var b = [], c = (1 << g) - 1, a = 0; a < e.length * g; a += g) { b[a >> 5] |= (e.charCodeAt(a / g) & c) << 24 - a % 32; } return b; } var g = 8; return function (e) { var b = _oauth_consumer_secret + "&" + (null !== _oauth_token_secret ? _oauth_token_secret : ""); if (_oauth_consumer_secret === null) { console.warn("To generate a hash, the consumer secret must be set."); } var c = q(b); if (c.length > 16) { c = n(c, b.length * g); } b = new Array(16); for (var a = new Array(16), d = 0; d < 16; d++) { a[d] = c[d] ^ 909522486; b[d] = c[d] ^ 1549556828; } c = n(a.concat(q(e)), 512 + e.length * g); b = n(b.concat(c), 672); c = ""; for (a = 0; a < 4 * b.length; a += 3) { for (d = (b[a >> 2] >> 8 * (3 - a % 4) & 255) << 16 | (b[a + 1 >> 2] >> 8 * (3 - (a + 1) % 4) & 255) << 8 | b[a + 2 >> 2] >> 8 * (3 - (a + 2) % 4) & 255, e = 0; 4 > e; e++) { c = 8 * a + 6 * e > 32 * b.length ? c + "=" : c + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" .charAt(d >> 6 * (3 - e) & 63); } } return c; }; }(); /* * Gets the base64 representation for the given data * * http://phpjs.org * + original by: Tyler Akins (http://rumkin.com) * + improved by: Bayron Guevara * + improved by: Thunder.m * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) * + bugfixed by: Pellentesque Malesuada * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) * + improved by: Rafał Kukawski (http://kukawski.pl) * * @param string data The data to calculate the base64 representation from * * @return string The base64 representation */ var _base64_encode = function (a) { var d, e, f, b, g = 0, h = 0, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", c = []; if (!a) { return a; } do { d = a.charCodeAt(g++); e = a.charCodeAt(g++); f = a.charCodeAt(g++); b = d << 16 | e << 8 | f; d = b >> 18 & 63; e = b >> 12 & 63; f = b >> 6 & 63; b &= 63; c[h++] = i.charAt(d) + i.charAt(e) + i.charAt(f) + i.charAt(b); } while (g < a.length); c = c.join(""); a = a.length % 3; return (a ? c.slice(0, a - 3) : c) + "===".slice(a || 3); }; /* * Builds a HTTP query string from the given data * * http://phpjs.org * + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) * + improved by: Legaev Andrey * + improved by: Michael White (http://getsprink.com) * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) * + improved by: Brett Zamir (http://brett-zamir.me) * + revised by: stag019 * + input by: Dreamer * + bugfixed by: Brett Zamir (http://brett-zamir.me) * + bugfixed by: MIO_KODUKI (http://mio-koduki.blogspot.com/) * * @param string data The data to concatenate * * @return string The HTTP query */ var _http_build_query = function (e, f, b) { function g(c, a, d) { var b, e = []; if (a === true) { a = "1"; } else if (a === false) { a = "0"; } if (null !== a) { if (typeof a === "object") { for (b in a) { if (a[b] !== null) { e.push(g(c + "[" + b + "]", a[b], d)); } } return e.join(d); } if (typeof a !== "function") { return _url(c) + "=" + _url(a); } console.warn("There was an error processing for http_build_query()."); } else { return ""; } } var d, c, h = []; if (! b) { b = "&"; } for (c in e) { d = e[c]; if (f && ! isNaN(c)) { c = String(f) + c; } d = g(c, d, b); if (d !== "") { h.push(d); } } return h.join(b); }; /** * Generates a (hopefully) unique random string * * @param int optional length The length of the string to generate * * @return string The random string */ var _nonce = function (length) { if (typeof length === "undefined") { length = 8; } if (length < 1) { console.warn("Invalid nonce length."); } var nonce = ""; for (var i = 0; i < length; i++) { var character = Math.floor(Math.random() * 61); nonce += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".substring(character, character + 1); } return nonce; }; /** * Sort array elements by key * * @param array input_arr The array to sort * * @return array The sorted keys */ var _ksort = function (input_arr) { var keys = [], sorter, k; sorter = function (a, b) { var a_float = parseFloat(a), b_float = parseFloat(b), a_numeric = a_float + "" === a, b_numeric = b_float + "" === b; if (a_numeric && b_numeric) { return a_float > b_float ? 1 : a_float < b_float ? -1 : 0; } else if (a_numeric && !b_numeric) { return 1; } else if (!a_numeric && b_numeric) { return -1; } return a > b ? 1 : a < b ? -1 : 0; }; // Make a list of key names for (k in input_arr) { if (input_arr.hasOwnProperty(k)) { keys.push(k); } } keys.sort(sorter); return keys; }; /** * Clone objects * * @param object obj The object to clone * * @return object clone The cloned object */ var _clone = function (obj) { var clone = {}; for (var i in obj) { if (typeof(obj[i]) === "object") { clone[i] = _clone(obj[i]); } else { clone[i] = obj[i]; } } return clone; }; /** * Generates an OAuth signature * * @param string httpmethod Usually either 'GET' or 'POST' or 'DELETE' * @param string method The API method to call * @param array optional params The API call parameters, associative * @param bool optional append_to_get Whether to append the OAuth params to GET * * @return string Authorization HTTP header */ var _sign = function (httpmethod, method, params, append_to_get) { if (typeof params === "undefined") { params = {}; } if (typeof append_to_get === "undefined") { append_to_get = false; } if (_oauth_consumer_key === null) { console.warn("To generate a signature, the consumer key must be set."); } var sign_params = { consumer_key: _oauth_consumer_key, version: "1.0", timestamp: Math.round(new Date().getTime() / 1000), nonce: _nonce(), signature_method: "HMAC-SHA1" }; var sign_base_params = {}; var value; for (var key in sign_params) { value = sign_params[key]; sign_base_params["oauth_" + key] = _url(value); } if (_oauth_token !== null) { sign_base_params.oauth_token = _url(_oauth_token); } var oauth_params = _clone(sign_base_params); for (key in params) { value = params[key]; sign_base_params[key] = value; } var keys = _ksort(sign_base_params); var sign_base_string = ""; for (var i = 0; i < keys.length; i++) { key = keys[i]; value = sign_base_params[key]; sign_base_string += key + "=" + _url(value) + "&"; } sign_base_string = sign_base_string.substring(0, sign_base_string.length - 1); var signature = _sha1(httpmethod + "&" + _url(method) + "&" + _url(sign_base_string)); params = append_to_get ? sign_base_params : oauth_params; params.oauth_signature = signature; keys = _ksort(params); var authorization = ""; if (append_to_get) { for(i = 0; i < keys.length; i++) { key = keys[i]; value = params[key]; authorization += key + "=" + _url(value) + "&"; } return authorization.substring(0, authorization.length - 1); } authorization = "OAuth "; for (i = 0; i < keys.length; i++) { key = keys[i]; value = params[key]; authorization += key + "=\"" + _url(value) + "\", "; } return authorization.substring(0, authorization.length - 2); }; /** * Detects HTTP method to use for API call * * @param string method The API method to call * @param array params The parameters to send along * * @return string The HTTP method that should be used */ var _detectMethod = function (method, params) { // multi-HTTP method endpoints switch (method) { case "account/settings": case "account/login_verification_enrollment": case "account/login_verification_request": method = params.length ? method + "__post" : method; break; } var httpmethods = {}; httpmethods.GET = [ // Timelines "statuses/mentions_timeline", "statuses/user_timeline", "statuses/home_timeline", "statuses/retweets_of_me", // Tweets "statuses/retweets/:id", "statuses/show/:id", "statuses/oembed", "statuses/retweeters/ids", // Search "search/tweets", // Direct Messages "direct_messages", "direct_messages/sent", "direct_messages/show", // Friends & Followers "friendships/no_retweets/ids", "friends/ids", "followers/ids", "friendships/lookup", "friendships/incoming", "friendships/outgoing", "friendships/show", "friends/list", "followers/list", "friendships/lookup", // Users "account/settings", "account/verify_credentials", "blocks/list", "blocks/ids", "users/lookup", "users/show", "users/search", "users/contributees", "users/contributors", "users/profile_banner", "mutes/users/ids", "mutes/users/list", // Suggested Users "users/suggestions/:slug", "users/suggestions", "users/suggestions/:slug/members", // Favorites "favorites/list", // Lists "lists/list", "lists/statuses", "lists/memberships", "lists/subscribers", "lists/subscribers/show", "lists/members/show", "lists/members", "lists/show", "lists/subscriptions", "lists/ownerships", // Saved searches "saved_searches/list", "saved_searches/show/:id", // Places & Geo "geo/id/:place_id", "geo/reverse_geocode", "geo/search", "geo/similar_places", // Trends "trends/place", "trends/available", "trends/closest", // OAuth "oauth/authenticate", "oauth/authorize", // Help "help/configuration", "help/languages", "help/privacy", "help/tos", "application/rate_limit_status", // Tweets "statuses/lookup", // Internal "users/recommendations", "account/push_destinations/device", "activity/about_me", "activity/by_friends", "statuses/media_timeline", "timeline/home", "help/experiments", "search/typeahead", "search/universal", "discover/universal", "conversation/show", "statuses/:id/activity/summary", "account/login_verification_enrollment", "account/login_verification_request", "prompts/suggest", "beta/timelines/custom/list", "beta/timelines/timeline", "beta/timelines/custom/show" ]; httpmethods.POST = [ // Tweets "statuses/destroy/:id", "statuses/update", "statuses/retweet/:id", "statuses/update_with_media", "media/upload", // Direct Messages "direct_messages/destroy", "direct_messages/new", // Friends & Followers "friendships/create", "friendships/destroy", "friendships/update", // Users "account/settings__post", "account/update_delivery_device", "account/update_profile", "account/update_profile_background_image", "account/update_profile_colors", "account/update_profile_image", "blocks/create", "blocks/destroy", "account/update_profile_banner", "account/remove_profile_banner", "mutes/users/create", "mutes/users/destroy", // Favorites "favorites/destroy", "favorites/create", // Lists "lists/members/destroy", "lists/subscribers/create", "lists/subscribers/destroy", "lists/members/create_all", "lists/members/create", "lists/destroy", "lists/update", "lists/create", "lists/members/destroy_all", // Saved Searches "saved_searches/create", "saved_searches/destroy/:id", // Spam Reporting "users/report_spam", // OAuth "oauth/access_token", "oauth/request_token", "oauth2/token", "oauth2/invalidate_token", // Internal "direct_messages/read", "account/login_verification_enrollment__post", "push_destinations/enable_login_verification", "account/login_verification_request__post", "beta/timelines/custom/create", "beta/timelines/custom/update", "beta/timelines/custom/destroy", "beta/timelines/custom/add", "beta/timelines/custom/remove" ]; for (var httpmethod in httpmethods) { if (httpmethods[httpmethod].indexOf(method) > -1) { return httpmethod; } } console.warn("Can't find HTTP method to use for \"" + method + "\"."); }; /** * Detects if API call should use multipart/form-data * * @param string method The API method to call * * @return bool Whether the method should be sent as multipart */ var _detectMultipart = function (method) { var multiparts = [ // Tweets "statuses/update_with_media", // Users "account/update_profile_background_image", "account/update_profile_image", "account/update_profile_banner" ]; return multiparts.indexOf(method) > -1; }; /** * Build multipart request from upload params * * @param string method The API method to call * @param array params The parameters to send along * * @return null|string The built multipart request body */ var _buildMultipart = function (method, params) { // well, files will only work in multipart methods if (! _detectMultipart(method)) { return; } // only check specific parameters var possible_methods = [ // Tweets "statuses/update_with_media", // Accounts "account/update_profile_background_image", "account/update_profile_image", "account/update_profile_banner" ]; var possible_files = { // Tweets "statuses/update_with_media": "media[]", // Accounts "account/update_profile_background_image": "image", "account/update_profile_image": "image", "account/update_profile_banner": "banner" }; // method might have files? if (possible_methods.indexOf(method) === -1) { return; } // check for filenames possible_files = possible_files[method].split(" "); var multipart_border = "--------------------" + _nonce(); var multipart_request = ""; for (var key in params) { multipart_request += "--" + multipart_border + "\r\n" + "Content-Disposition: form-data; name=\"" + key + "\""; if (possible_files.indexOf(key) > -1) { multipart_request += "\r\nContent-Transfer-Encoding: base64"; } multipart_request += "\r\n\r\n" + params[key] + "\r\n"; } multipart_request += "--" + multipart_border + "--"; return multipart_request; }; /** * Detects if API call is internal * * @param string method The API method to call * * @return bool Whether the method is defined in internal API */ var _detectInternal = function (method) { var internals = [ "users/recommendations" ]; return internals.join(" ").indexOf(method) > -1; }; /** * Detects if API call should use media endpoint * * @param string method The API method to call * * @return bool Whether the method is defined in media API */ var _detectMedia = function (method) { var medias = [ "media/upload" ]; return medias.join(" ").indexOf(method) > -1; }; /** * Detects if API call should use old endpoint * * @param string method The API method to call * * @return bool Whether the method is defined in old API */ var _detectOld = function (method) { var olds = [ "account/push_destinations/device" ]; return olds.join(" ").indexOf(method) > -1; }; /** * Builds the complete API endpoint url * * @param string method The API method to call * * @return string The URL to send the request to */ var _getEndpoint = function (method) { var url; if (method.substring(0, 5) === "oauth") { url = _endpoint_oauth + method; } else if (_detectMedia(method)) { url = _endpoint_media + method + ".json"; } else if (_detectOld(method)) { url = _endpoint_old + method + ".json"; } else { url = _endpoint + method + ".json"; } return url; }; /** * Gets the XML HTTP Request object, trying to load it in various ways * * @return object The XMLHttpRequest object instance */ var _getXmlRequestObject = function () { var xml = null; // first, try the W3-standard object if (typeof window === "object" && window && typeof window.XMLHttpRequest !== "undefined" ) { xml = new window.XMLHttpRequest(); // then, try Titanium framework object } else if (typeof Ti === "object" && Ti && typeof Ti.Network.createHTTPClient !== "undefined" ) { xml = Ti.Network.createHTTPClient(); // are we in an old Internet Explorer? } else if (typeof ActiveXObject !== "undefined" ) { try { xml = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { console.error("ActiveXObject object not defined."); } // now, consider RequireJS and/or Node.js objects } else if (typeof require === "function" && require ) { // look for xmlhttprequest module try { var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; xml = new XMLHttpRequest(); } catch (e1) { // or maybe the user is using xhr2 try { var XMLHttpRequest = require("xhr2"); xml = new XMLHttpRequest(); } catch (e2) { console.error("xhr2 object not defined, cancelling."); } } } return xml; }; /** * Calls the API using cURL * * @param string httpmethod The HTTP method to use for making the request * @param string method The API method to call * @param array optional params The parameters to send along * @param bool optional multipart Whether to use multipart/form-data * @param bool optional app_only_auth Whether to use app-only bearer authentication * @param bool optional internal Whether to use internal call * @param function callback The function to call with the API call result * * @return mixed The API reply, encoded in the set return_format */ var _callApi = function (httpmethod, method, params, multipart, app_only_auth, internal, callback) { if (typeof params === "undefined") { params = {}; } if (typeof multipart === "undefined") { multipart = false; } if (typeof app_only_auth === "undefined") { app_only_auth = false; } if (typeof callback !== "function") { callback = function () {}; } if (internal) { params.adc = "phone"; params.application_id = 333903271; } var url = _getEndpoint(method); var authorization = null; var xml = _getXmlRequestObject(); if (xml === null) { return; } var post_fields; if (httpmethod === "GET") { var url_with_params = url; if (JSON.stringify(params) !== "{}") { url_with_params += "?" + _http_build_query(params); } if (! app_only_auth) { authorization = _sign(httpmethod, url, params); } // append auth params to GET url for IE7-9, to send via JSONP if (_use_jsonp) { if (JSON.stringify(params) !== "{}") { url_with_params += "&"; } else { url_with_params += "?"; } var callback_name = _nonce(); window[callback_name] = function (reply) { reply.httpstatus = 200; var rate = null; if (typeof xml.getResponseHeader !== "undefined" && xml.getResponseHeader("x-rate-limit-limit") !== "" ) { rate = { limit: xml.getResponseHeader("x-rate-limit-limit"), remaining: xml.getResponseHeader("x-rate-limit-remaining"), reset: xml.getResponseHeader("x-rate-limit-reset") }; } callback(reply, rate); }; params.callback = callback_name; url_with_params = url + "?" + _sign(httpmethod, url, params, true); var tag = document.createElement("script"); tag.type = "text/javascript"; tag.src = url_with_params; var body = document.getElementsByTagName("body")[0]; body.appendChild(tag); return; } else if (_use_proxy) { url_with_params = url_with_params.replace( _endpoint_base, _endpoint_proxy ).replace( _endpoint_base_media, _endpoint_proxy ); } xml.open(httpmethod, url_with_params, true); } else { if (_use_jsonp) { console.warn("Sending POST requests is not supported for IE7-9."); return; } if (multipart) { if (! app_only_auth) { authorization = _sign(httpmethod, url, {}); } params = _buildMultipart(method, params); } else { if (! app_only_auth) { authorization = _sign(httpmethod, url, params); } params = _http_build_query(params); } post_fields = params; if (_use_proxy || multipart) { // force proxy for multipart base64 url = url.replace( _endpoint_base, _endpoint_proxy ).replace( _endpoint_base_media, _endpoint_proxy ); } xml.open(httpmethod, url, true); if (multipart) { xml.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + post_fields.split("\r\n")[0].substring(2)); } else { xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } } if (app_only_auth) { if (_oauth_consumer_key === null && _oauth_bearer_token === null ) { console.warn("To make an app-only auth API request, consumer key or bearer token must be set."); } // automatically fetch bearer token, if necessary if (_oauth_bearer_token === null) { return oauth2_token(function () { _callApi(httpmethod, method, params, multipart, app_only_auth, false, callback); }); } authorization = "Bearer " + _oauth_bearer_token; } if (authorization !== null) { xml.setRequestHeader((_use_proxy ? "X-" : "") + "Authorization", authorization); } xml.onreadystatechange = function () { if (xml.readyState >= 4) { var httpstatus = 12027; try { httpstatus = xml.status; } catch (e) {} var response = ""; try { response = xml.responseText; } catch (e) {} var reply = _parseApiReply(response); reply.httpstatus = httpstatus; var rate = null; if (typeof xml.getResponseHeader !== "undefined" && xml.getResponseHeader("x-rate-limit-limit") !== "" ) { rate = { limit: xml.getResponseHeader("x-rate-limit-limit"), remaining: xml.getResponseHeader("x-rate-limit-remaining"), reset: xml.getResponseHeader("x-rate-limit-reset") }; } callback(reply, rate); } }; xml.send(httpmethod === "GET" ? null : post_fields); return true; }; /** * Parses the API reply to encode it in the set return_format * * @param string reply The actual reply, JSON-encoded or URL-encoded * * @return array|object The parsed reply */ var _parseApiReply = function (reply) { if (typeof reply !== "string" || reply === "") { return {}; } if (reply === "[]") { return []; } var parsed; try { parsed = JSON.parse(reply); } catch (e) { parsed = {}; if (reply.indexOf("<" + "?xml version=\"1.0\" encoding=\"UTF-8\"?" + ">") === 0) { // we received XML... // since this only happens for errors, // don't perform a full decoding parsed.request = reply.match(/(.*)<\/request>/)[1]; parsed.error = reply.match(/(.*)<\/error>/)[1]; } else { // assume query format var elements = reply.split("&"); for (var i = 0; i < elements.length; i++) { var element = elements[i].split("=", 2); if (element.length > 1) { parsed[element[0]] = decodeURIComponent(element[1]); } else { parsed[element[0]] = null; } } } } return parsed; }; return { setConsumerKey: setConsumerKey, getVersion: getVersion, setToken: setToken, setBearerToken: setBearerToken, setUseProxy: setUseProxy, setProxy: setProxy, __call: __call, oauth_authenticate: oauth_authenticate, oauth_authorize: oauth_authorize, oauth2_token: oauth2_token }; }; if (typeof module === "object" && module && typeof module.exports === "object" ) { // Expose codebird as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = Codebird; } else { // Otherwise expose codebird to the global object as usual if (typeof window === "object" && window) { window.Codebird = Codebird; } // Register as a named AMD module, since codebird can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase codebird is used because AMD module names are // derived from file names, and codebird is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of codebird, it will work. if (typeof define === "function" && define.amd) { define("codebird", [], function () { return Codebird; }); } } })(); // doT.js // 2011, Laura Doktorova, https://github.com/olado/doT // Licensed under the MIT license. (function() { "use strict"; var doT = { version: '1.0.1', templateSettings: { evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g, interpolate: /\{\{=([\s\S]+?)\}\}/g, encode: /\{\{!([\s\S]+?)\}\}/g, use: /\{\{#([\s\S]+?)\}\}/g, useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g, define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g, defineParams:/^\s*([\w$]+):([\s\S]+)/, conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g, iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g, varname: 'it', strip: true, append: true, selfcontained: false }, template: undefined, //fn, compile template compile: undefined //fn, for express }, global; if (typeof module !== 'undefined' && module.exports) { module.exports = doT; } else if (typeof define === 'function' && define.amd) { define(function(){return doT;}); } else { global = (function(){ return this || (0,eval)('this'); }()); global.doT = doT; } function encodeHTMLSource() { var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/' }, matchHTML = /&(?!#?\w+;)|<|>|"|'|\//g; return function() { return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : this; }; } String.prototype.encodeHTML = encodeHTMLSource(); var startend = { append: { start: "'+(", end: ")+'", endencode: "||'').toString().encodeHTML()+'" }, split: { start: "';out+=(", end: ");out+='", endencode: "||'').toString().encodeHTML();out+='"} }, skip = /$^/; function resolveDefs(c, block, def) { return ((typeof block === 'string') ? block : block.toString()) .replace(c.define || skip, function(m, code, assign, value) { if (code.indexOf('def.') === 0) { code = code.substring(4); } if (!(code in def)) { if (assign === ':') { if (c.defineParams) value.replace(c.defineParams, function(m, param, v) { def[code] = {arg: param, text: v}; }); if (!(code in def)) def[code]= value; } else { new Function("def", "def['"+code+"']=" + value)(def); } } return ''; }) .replace(c.use || skip, function(m, code) { if (c.useParams) code = code.replace(c.useParams, function(m, s, d, param) { if (def[d] && def[d].arg && param) { var rw = (d+":"+param).replace(/'|\\/g, '_'); def.__exp = def.__exp || {}; def.__exp[rw] = def[d].text.replace(new RegExp("(^|[^\\w$])" + def[d].arg + "([^\\w$])", "g"), "$1" + param + "$2"); return s + "def.__exp['"+rw+"']"; } }); var v = new Function("def", "return " + code)(def); return v ? resolveDefs(c, v, def) : v; }); } function unescape(code) { return code.replace(/\\('|\\)/g, "$1").replace(/[\r\t\n]/g, ' '); } doT.template = function(tmpl, c, def) { c = c || doT.templateSettings; var cse = c.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv, str = (c.use || c.define) ? resolveDefs(c, tmpl, def || {}) : tmpl; str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g,' ') .replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,''): str) .replace(/'|\\/g, '\\$&') .replace(c.interpolate || skip, function(m, code) { return cse.start + unescape(code) + cse.end; }) .replace(c.encode || skip, function(m, code) { needhtmlencode = true; return cse.start + unescape(code) + cse.endencode; }) .replace(c.conditional || skip, function(m, elsecase, code) { return elsecase ? (code ? "';}else if(" + unescape(code) + "){out+='" : "';}else{out+='") : (code ? "';if(" + unescape(code) + "){out+='" : "';}out+='"); }) .replace(c.iterate || skip, function(m, iterate, vname, iname) { if (!iterate) return "';} } out+='"; sid+=1; indv=iname || "i"+sid; iterate=unescape(iterate); return "';var arr"+sid+"="+iterate+";if(arr"+sid+"){var "+vname+","+indv+"=-1,l"+sid+"=arr"+sid+".length-1;while("+indv+"0)for(c in Ib)d=Ib[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function o(a){return 0>a?Math.ceil(a):Math.floor(a)}function p(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.lengthd;d++)(c&&a[d]!==b[d]||!c&&A(a[d])!==A(b[d]))&&g++;return g+f}function x(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=jc[a]||kc[b]||b}return a}function y(a){var b,d,e={};for(d in a)c(a,d)&&(b=x(d),b&&(e[b]=a[d]));return e}function z(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}tb[b]=function(e,f){var g,h,i=tb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=tb().utc().set(d,a);return i.call(tb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function A(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function B(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function C(a,b,c){return hb(tb([a,11,31+b-c]),b,c).week}function D(a){return E(a)?366:365}function E(a){return a%4===0&&a%100!==0||a%400===0}function F(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Bb]<0||a._a[Bb]>11?Bb:a._a[Cb]<1||a._a[Cb]>B(a._a[Ab],a._a[Bb])?Cb:a._a[Db]<0||a._a[Db]>23?Db:a._a[Eb]<0||a._a[Eb]>59?Eb:a._a[Fb]<0||a._a[Fb]>59?Fb:a._a[Gb]<0||a._a[Gb]>999?Gb:-1,a._pf._overflowDayOfYear&&(Ab>b||b>Cb)&&(b=Cb),a._pf.overflow=b)}function G(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function H(a){return a?a.toLowerCase().replace("_","-"):a}function I(a){for(var b,c,d,e,f=0;f0;){if(d=J(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&w(e,c,!0)>=b-1)break;b--}f++}return null}function J(a){var b=null;if(!Hb[a]&&Jb)try{b=tb.locale(),require("./locale/"+a),tb.locale(b)}catch(c){}return Hb[a]}function K(a,b){return b._isUTC?tb(a).zone(b._offset||0):tb(a).local()}function L(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function M(a){var b,c,d=a.match(Nb);for(b=0,c=d.length;c>b;b++)d[b]=pc[d[b]]?pc[d[b]]:L(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function N(a,b){return a.isValid()?(b=O(b,a.localeData()),lc[b]||(lc[b]=M(b)),lc[b](a)):a.localeData().invalidDate()}function O(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Ob.lastIndex=0;d>=0&&Ob.test(a);)a=a.replace(Ob,c),Ob.lastIndex=0,d-=1;return a}function P(a,b){var c,d=b._strict;switch(a){case"Q":return Zb;case"DDDD":return _b;case"YYYY":case"GGGG":case"gggg":return d?ac:Rb;case"Y":case"G":case"g":return cc;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?bc:Sb;case"S":if(d)return Zb;case"SS":if(d)return $b;case"SSS":if(d)return _b;case"DDD":return Qb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ub;case"a":case"A":return b._locale._meridiemParse;case"X":return Xb;case"Z":case"ZZ":return Vb;case"T":return Wb;case"SSSS":return Tb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?$b:Pb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Pb;case"Do":return Yb;default:return c=new RegExp(Y(X(a.replace("\\","")),"i"))}}function Q(a){a=a||"";var b=a.match(Vb)||[],c=b[b.length-1]||[],d=(c+"").match(hc)||["-",0,0],e=+(60*d[1])+A(d[2]);return"+"===d[0]?-e:e}function R(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Bb]=3*(A(b)-1));break;case"M":case"MM":null!=b&&(e[Bb]=A(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b),null!=d?e[Bb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[Cb]=A(b));break;case"Do":null!=b&&(e[Cb]=A(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=A(b));break;case"YY":e[Ab]=tb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Ab]=A(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"H":case"HH":case"h":case"hh":e[Db]=A(b);break;case"m":case"mm":e[Eb]=A(b);break;case"s":case"ss":e[Fb]=A(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Gb]=A(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=Q(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=A(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=tb.parseTwoDigitYear(b)}}function S(a){var c,d,e,f,g,h,i;c=a._w,null!=c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[Ab],hb(tb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[Ab],hb(tb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=ib(d,e,f,h,g),a._a[Ab]=i.year,a._dayOfYear=i.dayOfYear}function T(a){var c,d,e,f,g=[];if(!a._d){for(e=V(a),a._w&&null==a._a[Cb]&&null==a._a[Bb]&&S(a),a._dayOfYear&&(f=b(a._a[Ab],e[Ab]),a._dayOfYear>D(f)&&(a._pf._overflowDayOfYear=!0),d=db(f,0,a._dayOfYear),a._a[Bb]=d.getUTCMonth(),a._a[Cb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];a._d=(a._useUTC?db:cb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm)}}function U(a){var b;a._d||(b=y(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],T(a))}function V(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function W(a){if(a._f===tb.ISO_8601)return void $(a);a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=""+a._i,h=g.length,i=0;for(d=O(a._f,a._locale).match(Nb)||[],b=0;b0&&a._pf.unusedInput.push(f),g=g.slice(g.indexOf(c)+c.length),i+=c.length),pc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),R(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=h-i,g.length>0&&a._pf.unusedInput.push(g),a._isPm&&a._a[Db]<12&&(a._a[Db]+=12),a._isPm===!1&&12===a._a[Db]&&(a._a[Db]=0),T(a),F(a)}function X(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Y(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(a){var b,c,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;fg)&&(e=g,c=b));m(a,c||b)}function $(a){var b,c,d=a._i,e=dc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=fc.length;c>b;b++)if(fc[b][1].exec(d)){a._f=fc[b][0]+(e[6]||" ");break}for(b=0,c=gc.length;c>b;b++)if(gc[b][1].exec(d)){a._f+=gc[b][0];break}d.match(Vb)&&(a._f+="Z"),W(a)}else a._isValid=!1}function _(a){$(a),a._isValid===!1&&(delete a._isValid,tb.createFromInputFallback(a))}function ab(a,b){var c,d=[];for(c=0;ca&&h.setFullYear(a),h}function db(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function eb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function fb(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function gb(a,b,c){var d=tb.duration(a).abs(),e=yb(d.as("s")),f=yb(d.as("m")),g=yb(d.as("h")),h=yb(d.as("d")),i=yb(d.as("M")),j=yb(d.as("y")),k=e0,k[4]=c,fb.apply({},k)}function hb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=tb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ib(a,b,c,d,e){var f,g,h=db(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:D(a-1)+g}}function jb(b){var c=b._i,d=b._f;return b._locale=b._locale||tb.localeData(b._l),null===c||d===a&&""===c?tb.invalid({nullInput:!0}):("string"==typeof c&&(b._i=c=b._locale.preparse(c)),tb.isMoment(c)?new k(c,!0):(d?u(d)?Z(b):W(b):bb(b),new k(b)))}function kb(a,b){var c,d;if(1===b.length&&u(b[0])&&(b=b[0]),!b.length)return tb();for(c=b[0],d=1;d=0?"+":"-";return b+p(Math.abs(a),6)},gg:function(){return p(this.weekYear()%100,2)},gggg:function(){return p(this.weekYear(),4)},ggggg:function(){return p(this.weekYear(),5)},GG:function(){return p(this.isoWeekYear()%100,2)},GGGG:function(){return p(this.isoWeekYear(),4)},GGGGG:function(){return p(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return A(this.milliseconds()/100)},SS:function(){return p(A(this.milliseconds()/10),2)},SSS:function(){return p(this.milliseconds(),3)},SSSS:function(){return p(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+":"+p(A(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+p(A(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},qc={},rc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];nc.length;)vb=nc.pop(),pc[vb+"o"]=i(pc[vb],vb);for(;oc.length;)vb=oc.pop(),pc[vb+vb]=h(pc[vb],2);pc.DDDD=h(pc.DDD,3),m(j.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=tb.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=tb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return hb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),tb=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=c,g._l=e,g._strict=f,g._isUTC=!1,g._pf=d(),jb(g)},tb.suppressDeprecationWarnings=!1,tb.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),tb.min=function(){var a=[].slice.call(arguments,0);return kb("isBefore",a)},tb.max=function(){var a=[].slice.call(arguments,0);return kb("isAfter",a)},tb.utc=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=c,g._strict=f,g._pf=d(),jb(g).utc()},tb.unix=function(a){return tb(1e3*a)},tb.duration=function(a,b){var d,e,f,g,h=a,i=null;return tb.isDuration(a)?h={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Lb.exec(a))?(d="-"===i[1]?-1:1,h={y:0,d:A(i[Cb])*d,h:A(i[Db])*d,m:A(i[Eb])*d,s:A(i[Fb])*d,ms:A(i[Gb])*d}):(i=Mb.exec(a))?(d="-"===i[1]?-1:1,f=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*d},h={y:f(i[2]),M:f(i[3]),d:f(i[4]),h:f(i[5]),m:f(i[6]),s:f(i[7]),w:f(i[8])}):"object"==typeof h&&("from"in h||"to"in h)&&(g=r(tb(h.from),tb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),e=new l(h),tb.isDuration(a)&&c(a,"_locale")&&(e._locale=a._locale),e},tb.version=wb,tb.defaultFormat=ec,tb.ISO_8601=function(){},tb.momentProperties=Ib,tb.updateOffset=function(){},tb.relativeTimeThreshold=function(b,c){return mc[b]===a?!1:c===a?mc[b]:(mc[b]=c,!0)},tb.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return tb.locale(a,b)}),tb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?tb.defineLocale(a,b):tb.localeData(a),c&&(tb.duration._locale=tb._locale=c)),tb._locale._abbr},tb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Hb[a]||(Hb[a]=new j),Hb[a].set(b),tb.locale(a),Hb[a]):(delete Hb[a],null)},tb.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(a){return tb.localeData(a)}),tb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return tb._locale;if(!u(a)){if(b=J(a))return b;a=[a]}return I(a)},tb.isMoment=function(a){return a instanceof k||null!=a&&c(a,"_isAMomentObject")},tb.isDuration=function(a){return a instanceof l};for(vb=rc.length-1;vb>=0;--vb)z(rc[vb]);tb.normalizeUnits=function(a){return x(a)},tb.invalid=function(a){var b=tb.utc(0/0);return null!=a?m(b._pf,a):b._pf.userInvalidated=!0,b},tb.parseZone=function(){return tb.apply(null,arguments).parseZone()},tb.parseTwoDigitYear=function(a){return A(a)+(A(a)>68?1900:2e3)},m(tb.fn=k.prototype,{clone:function(){return tb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=tb(this).utc();return 00:!1},parsingFlags:function(){return m({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._dateTzOffset(),"m")),this},format:function(a){var b=N(this,a||tb.defaultFormat);return this.localeData().postformat(b)},add:s(1,"add"),subtract:s(-1,"subtract"),diff:function(a,b,c){var d,e,f,g=K(a,this),h=6e4*(this.zone()-g.zone());return b=x(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+g.daysInMonth()),e=12*(this.year()-g.year())+(this.month()-g.month()),f=this-tb(this).startOf("month")-(g-tb(g).startOf("month")),f-=6e4*(this.zone()-tb(this).startOf("month").zone()-(g.zone()-tb(g).startOf("month").zone())),e+=f/d,"year"===b&&(e/=12)):(d=this-g,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-h)/864e5:"week"===b?(d-h)/6048e5:d),c?e:o(e)},from:function(a,b){return tb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(tb(),a)},calendar:function(a){var b=a||tb(),c=K(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this))},isLeapYear:function(){return E(this.year())},isDST:function(){return this.zone()+a):+this.clone().startOf(b)>+tb(a).startOf(b)},isBefore:function(a,b){return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+a>+this):+this.clone().startOf(b)<+tb(a).startOf(b)},isSame:function(a,b){return b=x(b||"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this===+a):+this.clone().startOf(b)===+K(a,this).startOf(b)},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),this>a?this:a}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._dateTzOffset():("string"==typeof a&&(a=Q(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateTzOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?t(this,tb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,tb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?tb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return B(this.year(),this.month())},dayOfYear:function(a){var b=yb((tb(this).startOf("day")-tb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=hb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=hb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=hb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return C(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return C(this.year(),a.dow,a.doy)},get:function(a){return a=x(a),this[a]()},set:function(a,b){return a=x(a),"function"==typeof this[a]&&this[a](b),this},locale:function(b){var c;return b===a?this._locale._abbr:(c=tb.localeData(b),null!=c&&(this._locale=c),this)},lang:f("moment().lang() is deprecated. Use moment().localeData() instead.",function(b){return b===a?this.localeData():this.locale(b)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),tb.fn.millisecond=tb.fn.milliseconds=ob("Milliseconds",!1),tb.fn.second=tb.fn.seconds=ob("Seconds",!1),tb.fn.minute=tb.fn.minutes=ob("Minutes",!1),tb.fn.hour=tb.fn.hours=ob("Hours",!0),tb.fn.date=ob("Date",!0),tb.fn.dates=f("dates accessor is deprecated. Use date instead.",ob("Date",!0)),tb.fn.year=ob("FullYear",!0),tb.fn.years=f("years accessor is deprecated. Use year instead.",ob("FullYear",!0)),tb.fn.days=tb.fn.day,tb.fn.months=tb.fn.month,tb.fn.weeks=tb.fn.week,tb.fn.isoWeeks=tb.fn.isoWeek,tb.fn.quarters=tb.fn.quarter,tb.fn.toJSON=tb.fn.toISOString,m(tb.duration.fn=l.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=o(d/1e3),g.seconds=a%60,b=o(a/60),g.minutes=b%60,c=o(b/60),g.hours=c%24,e+=o(c/24),h=o(pb(e)),e-=o(qb(h)),f+=o(e/30),e%=30,h+=o(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return o(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*A(this._months/12)},humanize:function(a){var b=gb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=tb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=tb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=x(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=x(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*pb(b),"month"===a?c:c/12;switch(b=this._days+qb(this._months/12),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":return 24*b*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:tb.fn.lang,locale:tb.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}}),tb.duration.fn.toString=tb.duration.fn.toISOString;for(vb in ic)c(ic,vb)&&rb(vb.toLowerCase());tb.duration.fn.asMilliseconds=function(){return this.as("ms")},tb.duration.fn.asSeconds=function(){return this.as("s")},tb.duration.fn.asMinutes=function(){return this.as("m")},tb.duration.fn.asHours=function(){return this.as("h")},tb.duration.fn.asDays=function(){return this.as("d")},tb.duration.fn.asWeeks=function(){return this.as("weeks")},tb.duration.fn.asMonths=function(){return this.as("M")},tb.duration.fn.asYears=function(){return this.as("y")},tb.locale("en",{ordinal:function(a){var b=a%10,c=1===A(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"; return a+c}}),Jb?module.exports=tb:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(xb.moment=ub),tb}),sb(!0)):sb()}).call(this); if (typeof Object.create !== 'function') { Object.create = function(obj) { function F() {} F.prototype = obj; return new F(); }; } (function($, window, document, undefined) { $.fn.socialfeed = function(_options) { var defaults = { plugin_folder: '', // a folder in which the plugin is located (with a slash in the end) template: 'template.html', // a path to the template file show_media: false, // show images of attachments if available media_min_width: 300, length: 500, // maximum length of post message shown date_format: 'll' }; //--------------------------------------------------------------------------------- var options = $.extend(defaults, _options), container = $(this), template, social_networks = ['facebook', 'instagram', 'vk', 'google', 'blogspot', 'twitter', 'pinterest', 'rss'], posts_to_load_count = 0, loaded_post_count = 0; // container.empty().css('display', 'block'); //--------------------------------------------------------------------------------- //--------------------------------------------------------------------------------- // This function performs consequent data loading from all of the sources by calling corresponding functions function calculatePostsToLoadCount() { social_networks.forEach(function(network) { if (options[network]) { if (options[network].accounts) { posts_to_load_count += options[network].limit * options[network].accounts.length; } else if (options[network].urls ){ posts_to_load_count += options[network].limit * options[network].urls.length; } else { posts_to_load_count += options[network].limit; } } }); } calculatePostsToLoadCount(); function fireCallback() { var fire = true; /*$.each(Object.keys(loaded), function() { if (loaded[this] > 0) fire = false; });*/ if (fire && options.callback) { options.callback(); } } var Utility = { request: function(url, callback) { $.ajax({ url: url, dataType: 'jsonp', success: callback }); }, get_request: function(url, callback) { $.get(url, callback, 'json'); }, wrapLinks: function(string, social_network) { var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; if (social_network === 'google-plus') { string = string.replace(/(@|#)([a-z0-9_]+['])/ig, Utility.wrapGoogleplusTagTemplate); } else { string = string.replace(exp, Utility.wrapLinkTemplate); } return string; }, wrapLinkTemplate: function(string) { return '' + string + '<\/a>'; }, wrapGoogleplusTagTemplate: function(string) { return '' + string + '<\/a>'; }, shorten: function(string) { string = $.trim(string); if (string.length > options.length) { return jQuery.trim(string).substring(0, options.length).split(" ").slice(0, -1).join(" ") + "..."; } else { return string; } }, stripHTML: function(string) { if (typeof string === "undefined" || string === null) { return ''; } return string.replace(/(<([^>]+)>)|nbsp;|\s{2,}|/ig, ""); } }; function SocialFeedPost(social_network, data) { this.content = data; this.content.social_network = social_network; this.content.attachment = (this.content.attachment === undefined) ? '' : this.content.attachment; this.content.time_ago = data.dt_create.fromNow(); this.content.date = data.dt_create.format(options.date_format); this.content.dt_create = this.content.dt_create.valueOf(); this.content.text = Utility.wrapLinks(Utility.shorten(data.message + ' ' + data.description), data.social_network); this.content.moderation_passed = (options.moderation) ? options.moderation(this.content) : true; Feed[social_network].posts.push(this); } SocialFeedPost.prototype = { render: function() { var rendered_html = Feed.template(this.content); var data = this.content; if ($(container).children('[social-feed-id=' + data.id + ']').length !== 0) { return false; } if ($(container).children().length === 0) { $(container).append(rendered_html); } else { var i = 0, insert_index = -1; $.each($(container).children(), function() { if ($(this).attr('dt-create') < data.dt_create) { insert_index = i; return false; } i++; }); $(container).append(rendered_html); if (insert_index >= 0) { insert_index++; var before = $(container).children('div:nth-child(' + insert_index + ')'), current = $(container).children('div:last-child'); $(current).insertBefore(before); } } if (options.media_min_width) { var query = '[social-feed-id=' + data.id + '] img.attachment'; var image = $(query); // preload the image var height, width = ''; var img = new Image(); var imgSrc = image.attr("src"); $(img).load(function() { if (img.width < options.media_min_width) { image.hide(); } // garbage collect img delete img; }).error(function() { // image couldnt be loaded image.hide(); }).attr({ src: imgSrc }); } loaded_post_count++; if (loaded_post_count == posts_to_load_count) { fireCallback(); $(document).trigger( 'smuzFeedPostsLoaded', [ 'arg' ] ); } } }; var Feed = { template: false, init: function() { Feed.getTemplate(function() { social_networks.forEach(function(network) { if (options[network]) { if ( options[network].accounts ) { //loaded[network] = 0; options[network].accounts.forEach(function(account) { //loaded[network]++; Feed[network].getData(account); }); } else if ( options[network].urls ) { options[network].urls.forEach(function(url) { Feed[network].getData(url); }); } else { Feed[network].getData(); } } }); }); }, getTemplate: function(callback) { if (Feed.template) return callback(); else { if (options.template_html) { Feed.template = doT.template(options.template_html); return callback(); } else { $.get(options.template, function(template_html) { Feed.template = doT.template(template_html); return callback(); }); } } }, twitter: { posts: [], loaded: false, api: 'http://api.tweecool.com/', getData: function(account) { if ( ! account ) return; var cb = new Codebird(); cb.setConsumerKey(options.twitter.consumer_key, options.twitter.consumer_secret); //Allow setting your own proxy with Codebird if (options.twitter.proxy !== undefined) { cb.setoxy(options.twitter.proxy); } switch (account[0]) { case '@': var userid = account.substr(1); cb.__call( "statuses_userTimeline", "id=" + userid + "&count=" + options.twitter.limit, Feed.twitter.utility.getPosts, true // this parameter required ); break; case '#': var hashtag = account.substr(1); cb.__call( "search_tweets", "q=" + hashtag + "&count=" + options.twitter.limit, function(reply) { Feed.twitter.utility.getPosts(reply.statuses); }, true // this parameter required ); break; default: } }, utility: { getPosts: function(json) { if (json) { $.each(json, function() { var element = this; var post = new SocialFeedPost('twitter', Feed.twitter.utility.unifyPostData(element)); post.render(); }); } }, unifyPostData: function(element) { var post = {}; if (element.id) { post.id = element.id; //prevent a moment.js console warning due to Twitter's poor date format. post.dt_create = moment(new Date(element.created_at)); post.author_link = 'http://twitter.com/' + element.user.screen_name; post.author_picture = element.user.profile_image_url; post.post_url = post.author_link + '/status/' + element.id_str; post.author_name = element.user.name; post.message = element.text; post.description = ''; post.link = 'http://twitter.com/' + element.user.screen_name + '/status/' + element.id_str; if (options.show_media === true) { if (element.entities.media && element.entities.media.length > 0) { var image_url = element.entities.media[0].media_url; if (image_url) { post.attachment = ''; } } } } return post; } } }, facebook: { posts: [], graph: 'https://graph.facebook.com/', loaded: false, getData: function(account) { if ( ! account ) return false; var proceed = function(request_url){ Utility.request(request_url, Feed.facebook.utility.getPosts); }; var fields = '?fields=id,from,message,created_time,story'; fields += (options.show_media === true)?',picture.width(500),attachments':''; var request_url, limit = '&limit=' + options.facebook.limit, query_extention = '&access_token=' + options.facebook.access_token + '&callback=?'; switch (account[0]) { case '@': var username = account.substr(1); Feed.facebook.utility.getUserId(username, function(userdata) { if (userdata.id !== '') { request_url = Feed.facebook.graph + 'v2.4/' + userdata.id + '/posts'+ fields + limit + query_extention; proceed(request_url); } }); break; case '!': var page = account.substr(1); request_url = Feed.facebook.graph + 'v2.4/' + page + '/feed'+ fields + limit + query_extention; proceed(request_url); break; default: proceed(request_url); } }, utility: { getUserId: function(username, callback) { var query_extention = '&access_token=' + options.facebook.access_token + '&callback=?'; var url = 'https://graph.facebook.com/' + username + '?' + query_extention; var result = ''; $.get(url, callback, 'json'); }, prepareAttachment: function(element) { var image_url = element.picture; if ( element.attachments.data[0].media ) { image_url = element.attachments.data[0].media.image.src; } else { console.log(element.attachments.data[0].subattachments.data[0].media.image.src); image_url = element.attachments.data[0].subattachments.data[0].media.image.src; } if ( image_url === undefined ) return; /* if (image_url.indexOf('_b.') !== -1) { //do nothing it is already big } else if (image_url.indexOf('safe_image.php') !== -1) { image_url = Feed.facebook.utility.getExternalImageURL(image_url, 'url'); } else if (image_url.indexOf('app_full_proxy.php') !== -1) { image_url = Feed.facebook.utility.getExternalImageURL(image_url, 'src'); } else if (element.object_id) { image_url = Feed.facebook.graph + element.object_id + '/picture/?type=normal'; }*/ return ''; }, prepareVideoAttachment: function(element) { return '
'; }, getExternalImageURL: function(image_url, parameter) { image_url = decodeURIComponent(image_url).split(parameter + '=')[1]; if (image_url.indexOf('fbcdn-sphotos') === -1) { return image_url.split('&')[0]; } else { return image_url; } }, getPosts: function(json) { //console.log(json['data']); if (json['data']) { json['data'].forEach(function(element) { var post = new SocialFeedPost('facebook', Feed.facebook.utility.unifyPostData(element)); post.render(); }); } }, unifyPostData: function(element) { var post = {}, text = (element.message) ? element.message : element.story; post.id = element.id; post.dt_create = moment(element.created_time); post.author_link = 'http://facebook.com/' + element.from.id; post.author_picture = Feed.facebook.graph + element.from.id + '/picture'; post.author_name = element.from.name; post.name = element.name || ""; post.message = (text) ? text : ''; post.description = (element.description) ? element.description : ''; post.link = (element.link) ? element.link : 'http://facebook.com/' + element.from.id; if ( post.link.search( '/videos/' ) !== -1 ) element.picture = 'video'; if (options.show_media === true) { if (element.picture == 'video' ) { var attachment = Feed.facebook.utility.prepareVideoAttachment(element); post.attachment = attachment; } else { var attachment = Feed.facebook.utility.prepareAttachment(element); if (attachment) { post.attachment = attachment; } } } return post; } } }, google: { posts: [], loaded: false, api: 'https://www.googleapis.com/plus/v1/', getData: function(account) { if ( ! account ) return false; var request_url; switch (account[0]) { case '#': var hashtag = account.substr(1); request_url = Feed.google.api + 'activities?query=' + hashtag + '&key=' + options.google.access_token + '&maxResults=' + options.google.limit; Utility.get_request(request_url, Feed.google.utility.getPosts); break; case '@': var username = account.substr(1); request_url = Feed.google.api + 'people/' + username + '/activities/public?key=' + options.google.access_token + '&maxResults=' + options.google.limit; Utility.get_request(request_url, Feed.google.utility.getPosts); break; default: } }, utility: { getPosts: function(json) { if (json.items) { $.each(json.items, function(i) { var post = new SocialFeedPost('google', Feed.google.utility.unifyPostData(json.items[i])); post.render(); }); } }, unifyPostData: function(element) { var post = {}; post.id = element.id; post.attachment = ''; post.description = ''; post.dt_create = moment(element.published); post.author_link = element.actor.url; post.author_picture = element.actor.image.url; post.author_name = element.actor.displayName; if (options.show_media === true) { if (element.object.attachments) { $.each(element.object.attachments, function() { var image = ''; if (this.fullImage) { image = this.fullImage.url; } else { if (this.objectType === 'album') { if (this.thumbnails && this.thumbnails.length > 0) { if (this.thumbnails[0].image) { image = this.thumbnails[0].image.url; } } } } post.attachment = ''; }); } } post.message = element.title; post.link = element.url; return post; } } }, instagram: { posts: [], api: 'https://api.instagram.com/v1/', loaded: false, username: '', accessType: function() { // If we have both the client_id and access_token set in options, // use access_token for authentication. If client_id is not set // then use access_token. If neither are set, log an error to console. if (typeof options.instagram.access_token === 'undefined' && typeof options.instagram.client_id === 'undefined') { console.log('You need to define a client_id or access_token to authenticate with Instagram\'s API.'); return undefined; } if (options.instagram.access_token) { options.instagram.client_id = undefined; } options.instagram.access_type = (typeof options.instagram.client_id === 'undefined' ? 'access_token' : 'client_id'); return options.instagram.access_type; }, getData: function(account) { var url; if ( ! account ) return false; // API endpoint URL depends on which authentication type we're using. if (this.accessType() !== 'undefined') { var authTokenParams = options.instagram.access_type + '=' + options.instagram[options.instagram.access_type]; } switch (account[0]) { case '@': var username = account.substr(1); //url = Feed.instagram.api + 'users/search/?q=' + username + '&' + authTokenParams + '&count=1' + '&callback=?'; options.instagram.username = username; url = Feed.instagram.api + 'users/' + username + '/media/recent/?' + authTokenParams + '&count='+ + options.instagram.limit +'&callback=?'; Utility.request(url, Feed.instagram.utility.getUsers); break; case '#': var hashtag = account.substr(1); url = Feed.instagram.api + 'tags/' + hashtag + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; Utility.request(url, Feed.instagram.utility.getImages); break; case '&': var id = account.substr(1); url = Feed.instagram.api + 'users/' + id + '/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; Utility.request(url, Feed.instagram.utility.getUsers); default: } }, utility: { getImages: function(json) { if (json.data) { json.data.forEach(function(element) { var post = new SocialFeedPost('instagram', Feed.instagram.utility.unifyPostData(element)); post.render(); }); } }, getUsers: function(json) { // API endpoint URL depends on which authentication type we're using. if (options.instagram.access_type !== 'undefined') { var authTokenParams = options.instagram.access_type + '=' + options.instagram[options.instagram.access_type]; } if (!jQuery.isArray(json.data)) json.data = [json.data] json.data.forEach(function(user) { var url = Feed.instagram.api + 'users/' + options.instagram.username + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; Utility.request(url, Feed.instagram.utility.getImages); }); }, unifyPostData: function(element) { var post = {}; post.id = element.id; post.dt_create = moment(element.created_time * 1000); post.author_link = 'http://instagram.com/' + element.user.username; post.author_picture = element.user.profile_picture; post.author_name = element.user.full_name || element.user.username; post.message = (element.caption && element.caption) ? element.caption.text : ''; post.description = ''; post.link = element.link; if (options.show_media) { post.attachment = ''; } return post; } } }, vk: { posts: [], loaded: false, base: 'http://vk.com/', api: 'https://api.vk.com/method/', user_json_template: 'https://api.vk.com/method/' + 'users.get?fields=first_name,%20last_name,%20screen_name,%20photo&uid=', group_json_template: 'https://api.vk.com/method/' + 'groups.getById?fields=first_name,%20last_name,%20screen_name,%20photo&gid=', getData: function(account) { var request_url; switch (account[0]) { case '@': var username = account.substr(1); request_url = Feed.vk.api + 'wall.get?owner_id=' + username + '&filter=' + options.vk.source + '&count=' + options.vk.limit + '&callback=?'; Utility.get_request(request_url, Feed.vk.utility.getPosts); break; case '#': var hashtag = account.substr(1); request_url = Feed.vk.api + 'newsfeed.search?q=' + hashtag + '&count=' + options.vk.limit + '&callback=?'; Utility.get_request(request_url, Feed.vk.utility.getPosts); break; default: } }, utility: { getPosts: function(json) { if (json.response) { $.each(json.response, function() { if (this != parseInt(this) && this.post_type === 'post') { var owner_id = (this.owner_id) ? this.owner_id : this.from_id, vk_wall_owner_url = (owner_id > 0) ? (Feed.vk.user_json_template + owner_id + '&callback=?') : (Feed.vk.group_json_template + (-1) * owner_id + '&callback=?'), element = this; Utility.get_request(vk_wall_owner_url, function(wall_owner) { Feed.vk.utility.unifyPostData(wall_owner, element, json); }); } }); } }, unifyPostData: function(wall_owner, element, json) { var post = {}; post.id = element.id; post.dt_create = moment.unix(element.date); post.description = ' '; post.message = Utility.stripHTML(element.text); if (options.show_media) { if (element.attachment) { if (element.attachment.type === 'link') post.attachment = ''; if (element.attachment.type === 'video') post.attachment = ''; if (element.attachment.type === 'photo') post.attachment = ''; } } if (element.from_id > 0) { var vk_user_json = Feed.vk.user_json_template + element.from_id + '&callback=?'; Utility.get_request(vk_user_json, function(user_json) { var vk_post = new SocialFeedPost('vk', Feed.vk.utility.getUser(user_json, post, element, json)); vk_post.render(); }); } else { var vk_group_json = Feed.vk.group_json_template + (-1) * element.from_id + '&callback=?'; Utility.get_request(vk_group_json, function(user_json) { var vk_post = new SocialFeedPost('vk', Feed.vk.utility.getGroup(user_json, post, element, json)); vk_post.render(); }); } }, getUser: function(user_json, post, element, json) { post.author_name = user_json.response[0].first_name + ' ' + user_json.response[0].last_name; post.author_picture = user_json.response[0].photo; post.author_link = Feed.vk.base + user_json.response[0].screen_name; post.link = Feed.vk.base + user_json.response[0].screen_name + '?w=wall' + element.from_id + '_' + element.id; return post; }, getGroup: function(user_json, post, element, json) { post.author_name = user_json.response[0].name; post.author_picture = user_json.response[0].photo; post.author_link = Feed.vk.base + user_json.response[0].screen_name; post.link = Feed.vk.base + user_json.response[0].screen_name + '?w=wall-' + user_json.response[0].gid + '_' + element.id; return post; } } }, blogspot: { loaded: false, getData: function(account) { var url; switch (account[0]) { case '@': var username = account.substr(1); url = 'http://' + username + '.blogspot.com/feeds/posts/default?alt=json-in-script&callback=?'; request(url, getPosts); break; default: } }, utility: { getPosts: function(json) { $.each(json.feed.entry, function() { var post = {}, element = this; post.id = element.id['$t'].replace(/[^a-z0-9]/gi, ''); post.dt_create = moment((element.published['$t'])); post.author_link = element.author[0]['uri']['$t']; post.author_picture = 'http:' + element.author[0]['gd$image']['src']; post.author_name = element.author[0]['name']['$t']; post.message = element.title['$t'] + '

' + stripHTML(element.content['$t']); post.description = ''; post.link = element.link.pop().href; if (options.show_media) { if (element['media$thumbnail']) { post.attachment = ''; } } post.render(); }); } } }, pinterest: { posts: [], loaded: false, apiv1: 'https://api.pinterest.com/v1/', getData: function(account) { var request_url, limit = 'limit=' + options.pinterest.limit, fields = 'fields=id,created_at,link,note,creator(url,first_name,last_name,image),image', query_extention = fields + '&access_token=' + options.pinterest.access_token + '&' + limit + '&callback=?'; switch (account[0]) { case '@': var username = account.substr(1); if (username === 'me') { request_url = Feed.pinterest.apiv1 + 'me/pins/?' + query_extention; } else { request_url = Feed.pinterest.apiv1 + 'boards/' + username + '/pins?' + query_extention; } break; default: } Utility.request(request_url, Feed.pinterest.utility.getPosts); }, utility: { getPosts: function(json) { json.data.forEach(function(element) { var post = new SocialFeedPost('pinterest', Feed.pinterest.utility.unifyPostData(element)); post.render(); }); }, unifyPostData: function(element){ var post = {}; post.id = element.id; post.dt_create= moment(element.created_at); post.author_link = element.creator.url; post.author_picture = element.creator.image['60x60' ].url; post.author_name = element.creator.first_name + element.creator.last_name; post.message = element.note; post.description = ''; post.social_network = 'pinterest'; post.link = element.link ? element.link : 'https://www.pinterest.com/pin/' + element.id; if (options.show_media) { post.attachment = ''; } return post; } } }, rss : { posts: [], loaded: false, api : 'https://query.yahooapis.com/v1/public/yql?q=', datatype: 'json', getData: function(url) { var limit = options.rss.limit, yql = encodeURIComponent('select entry FROM feednormalizer where url=\'' + url + '\' AND output=\'atom_1.0\' | truncate(count=' + limit + ')' ), request_url = Feed.rss.api + yql + '&format=json&callback=?'; Utility.request(request_url, Feed.rss.utility.getPosts, Feed.rss.datatype); }, utility: { getPosts: function(json) { console.log(json); if (json.query.count > 0 ){ $.each(json.query.results.feed, function(index, element) { var post = new SocialFeedPost('rss', Feed.rss.utility.unifyPostData(index, element)); post.render(); }); } }, unifyPostData: function(index, element){ var item = element; if ( element.entry !== undefined ){ item = element.entry; } var post = {}; post.id = '"' + item.id + '"'; post.dt_create= moment(item.published, 'YYYY-MM-DDTHH:mm:ssZ', 'en'); post.author_link = ''; post.author_picture = ''; post.author_name = ''; if( item.creator !== undefined ){ post.author_name = item.creator; } post.message = item.title; post.description = ''; if( item.summary !== undefined ){ post.description = Utility.stripHTML(item.summary.content); } post.social_network = 'rss'; post.link = item.link.href; if (options.show_media && item.thumbnail !== undefined ) { post.attachment = ''; } return post; } } } }; //make the plugin chainable return this.each(function() { // Initialization Feed.init(); if (options.update_period) { setInterval(function() { return Feed.init(); }, options.update_period); } }) }; })(jQuery); (function($) { $(document).ready(function() { $.ajaxSetup({ cache: true }); $.getScript('//connect.facebook.net/en_US/sdk.js', function(){ FB.init({ version: 'v2.5', xfbml: true }); }); $('.social-feed-container').each( function() { var selector = $('#feed'+ $(this).data('id') ); var ajaxLink = selector.data('ajaxlink'); var fb_username = selector.data('facebook'); var tw_username = selector.data('twitter'); var tw_id = selector.data('twitterid'); var tw_secret = selector.data('twittersecret'); var fb_limit = selector.data('fblimit'); var tw_limit = selector.data('twlimit'); var insta_limit = selector.data('instalimit'); var fb_token = selector.data('fbtoken'); var insta_username = selector.data('instagram'); var insta_token = selector.data('instagramtoken'); var layout = selector.data('template'); var facebook_arr = { limit: 0 }; var twitter_arr = { limit: 0 }; var insta_arr = { limit: 0 }; var template = '' if ( layout == 'layout' ) { template = '
'; } if ( layout == 'layout1' ) { template = ''; } if ( layout == 'layout2' ) { template = ''; } if ( layout == 'layout3' ) { template = ''; } if ( layout == 'layout4' ) { template = ''; } if ( layout == 'layout5' ) { template = ''; } if ( selector.data('isfb') == '1' ) { facebook_arr = { accounts: [fb_username], limit: parseInt( fb_limit ), access_token: fb_token }; } if ( selector.data('istw') == '1' ) { twitter_arr = { accounts: [tw_username], limit: parseInt( tw_limit ), consumer_key: tw_id, // make sure to have your app read-only consumer_secret: tw_secret // make sure to have your app read-only }; } if ( selector.data('isinsta') == '1' ) { insta_arr = { accounts: [insta_username], limit: parseInt( insta_limit ), client_id: '6fe1728b3e7844a4a0065ee7465166e7', access_token: insta_token }; } selector.parent().append( '
' ); selector.hide(); selector.socialfeed({ facebook: facebook_arr, twitter: twitter_arr, instagram: insta_arr, template_html: template, show_media: true, length:400, callback: function() { setTimeout( function() { $('.smfeed-ajax-spinner').hide(); selector.show(); selector.packery({ // options... itemSelector: '.grid-item', gutter: 10 }); }, 1000 ); setTimeout( function() { selector.packery({ // options... itemSelector: '.grid-item', gutter: 10 }); }, 4000 ); window.smuzcallbackWorking = true; } }); setTimeout( function() { if ( window.smuzcallbackWorking ) return; $('.smfeed-ajax-spinner').hide(); selector.show(); selector.packery({ // options... itemSelector: '.grid-item', gutter: 10 }); }, 6000 ); }); } ); })( jQuery ); // source --> https://www.creditsmart.co.za/wp-content/plugins/google-analytics-for-wordpress/assets/js/frontend-gtag.min.js?ver=8.25.0 ;var MonsterInsights=function(){var e=[],i='',r=!1;this.setLastClicked=function(t,n,i){t=typeof t!=='undefined'?t:[];n=typeof n!=='undefined'?n:[];i=typeof i!=='undefined'?i:!1;e.valuesArray=t;e.fieldsArray=n};this.getLastClicked=function(){return e};this.setInternalAsOutboundCategory=function(e){i=e};this.getInternalAsOutboundCategory=function(){return i};this.sendEvent=function(e,t,n){y(e,t,n,[])};function d(){if(window.monsterinsights_debug_mode){return!0} else{return!1}};function p(e,t,n){var l={};for(var i in e){if(!e.hasOwnProperty(i)){continue};if(t&&t.indexOf(i)===-1){continue};if(n&&n.indexOf(i)>-1){continue};l[i]=e[i]};return l};function b(e,t,n){if(!monsterinsights_frontend.v4_id||e!=='event'){return};var i=n.event_category||'',a=['event_name','event_category','event_label','value',],l=p(n,null,a);l.action=t;l.send_to=monsterinsights_frontend.v4_id;let hitType=i.replace('-','_');if(i.indexOf('outbound-link')!==-1){hitType='click'} else if(i==='download'){hitType='file_download'};__gtagTracker(e,hitType,l)};function l(t,i,l,a){t=typeof t!=='undefined'?t:'event';i=typeof i!=='undefined'?i:'';a=typeof a!=='undefined'?a:[];l=typeof l!=='undefined'?l:{};b(t,i,l);e.valuesArray=a;e.fieldsArray=l;e.fieldsArray.event_action=i;e.tracked=!0;n('Tracked: '+a.type);n(e)};function y(t,i,l,a){t=typeof t!=='undefined'?t:'event';i=typeof i!=='undefined'?i:'';a=typeof a!=='undefined'?a:[];l=typeof l!=='undefined'?l:{};__gtagTracker(t,i,l);e.valuesArray=a;e.fieldsArray=l;e.fieldsArray.event_action=i;e.tracked=!0;n('Tracked: '+a.type);n(e)};function t(t){t=typeof t!=='undefined'?t:[];e.valuesArray=t;e.fieldsArray=[];e.tracked=!1;n('Not Tracked: '+t.exit);n(e)};function n(e){if(d()){console.dir(e)}};function o(e){return e.replace(/^\s+|\s+$/gm,'')};function c(){var n=0,e=document.domain,i=e.split('.'),t='_gd'+(new Date()).getTime();while(n<(i.length-1)&&document.cookie.indexOf(t+'='+t)==-1){e=i.slice(-1-(++n)).join('.');document.cookie=t+'='+t+';domain='+e+';'};document.cookie=t+'=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain='+e+';';return e};function u(e){e=e.toString();e=e.substring(0,(e.indexOf('#')==-1)?e.length:e.indexOf('#'));e=e.substring(0,(e.indexOf('?')==-1)?e.length:e.indexOf('?'));e=e.substring(e.lastIndexOf('/')+1,e.length);if(e.length>0&&e.indexOf('.')!==-1){e=e.substring(e.lastIndexOf('.')+1);return e} else{return''}};function x(e){return e.which==1||e.which==2||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey};function h(){var e=[];if(typeof monsterinsights_frontend.download_extensions=='string'){e=monsterinsights_frontend.download_extensions.split(',')};return e};function g(){var e=[];if(typeof monsterinsights_frontend.inbound_paths=='string'){e=JSON.parse(monsterinsights_frontend.inbound_paths)};return e};function w(e){if(e.which==1){return'event.which=1'} else if(e.which==2){return'event.which=2'} else if(e.metaKey){return'metaKey'} else if(e.ctrlKey){return'ctrlKey'} else if(e.shiftKey){return'shiftKey'} else if(e.altKey){return'altKey'} else{return''}};function A(e){var f=h(),l=g(),t='unknown',d=e.href,v=u(e.href),m=c(),r=e.hostname,a=e.protocol,k=e.pathname;d=d.toString();var s,p,b=e.getAttribute('data-vars-ga-category');if(b){return b};if(d.match(/^javascript\:/i)){t='internal'} else if(a&&a.length>0&&(o(a)=='tel'||o(a)=='tel:')){t='tel'} else if(a&&a.length>0&&(o(a)=='mailto'||o(a)=='mailto:')){t='mailto'} else if(r&&m&&r.length>0&&m.length>0&&!r.endsWith('.'+m)&&r!==m){t='external'} else if(k&&JSON.stringify(l)!='{}'&&k.length>0){var y=l.length;for(var n=0;n0&&l[n].label.length>0&&k.startsWith(l[n].path)){t='internal-as-outbound';i='outbound-link-'+l[n].label;break}}} else if(r&&window.monsterinsights_experimental_mode&&r.length>0&&document.domain.length>0&&r!==document.domain){t='cross-hostname'};if(v&&(t==='unknown'||'external'===t)&&f.length>0&&v.length>0){for(s=0,p=f.length;s0&&(d.endsWith(f[s])||f[s]==v)){t='download';break}}};if(t==='unknown'){t='internal'};return t};function T(e,t){var n=(e.target&&!e.target.match(/^_(self|parent|top)$/i))?e.target:!1;if(t.ctrlKey||t.shiftKey||t.metaKey||t.which==2){n='_blank'};return n};function m(e){if(e.getAttribute('data-vars-ga-label')&&e.getAttribute('data-vars-ga-label').replace(/\n/ig,'')){return e.getAttribute('data-vars-ga-label').replace(/\n/ig,'')} else if(e.title&&e.title.replace(/\n/ig,'')){return e.title.replace(/\n/ig,'')} else if(e.innerText&&e.innerText.replace(/\n/ig,'')){return e.innerText.replace(/\n/ig,'')} else if(e.getAttribute('aria-label')&&e.getAttribute('aria-label').replace(/\n/ig,'')){return e.getAttribute('aria-label').replace(/\n/ig,'')} else if(e.alt&&e.alt.replace(/\n/ig,'')){return e.alt.replace(/\n/ig,'')} else if(e.textContent&&e.textContent.replace(/\n/ig,'')){return e.textContent.replace(/\n/ig,'')} else if(e.firstChild&&e.firstChild.tagName=='IMG'){return e.firstChild.src} else{return undefined}};function O(e){var i=e.children,l=0,a,n;for(var t=0;t>>0;if(i===0){return-1};t=i-1;if(arguments.length>1){t=Number(arguments[1]);if(t!=t){t=0} else if(t!=0&&t!=(1/0)&&t!=-(1/0)){t=(t>0||-1)*Math.floor(Math.abs(t))}};for(n=t>=0?Math.min(t,i-1):i-Math.abs(t);n>=0;n--){if(n in l&&l[n]===e){return n}};return-1}}},MonsterInsightsObject=new MonsterInsights();